#ifndef PUMPPULSECOMPENCALIBRATIONPAGE_H
#define PUMPPULSECOMPENCALIBRATIONPAGE_H

#include <QWidget>
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QTableView>
#include <QGroupBox>
#include <QTimer>
#include "tableviewex.h"
#include "modulehplcpumpdefine.h"
#include "hplcpumppulsecompencurvepage.h"

class HplcPumpPulseCompenCalibrationPage : public QWidget
{
    Q_OBJECT
public:
    explicit HplcPumpPulseCompenCalibrationPage(QWidget *parent = nullptr);
    virtual ~HplcPumpPulseCompenCalibrationPage() override;

public slots:
    QList<hplc::PumpPulseCompenCalibData> getData();
    void onSetData(const QList<hplc::PumpPulseCompenCalibData> &list);
    void onOpen();
    void onFind();
    void onStart();

protected:
    virtual void closeEvent(QCloseEvent *event) override;

public slots:
    void onParseCompleted(int id, const QVariant &var);

private:
    TableViewEx      *m_tableView;

    QPushButton                 *m_pbWorkMode;
    QPushButton                 *m_pbSet;
    QPushButton                 *m_pbGet;
    QPushButton                 *m_pbSave;
    QPushButton                 *m_pbClear;

    // 零点电压
    QComboBox *m_cbPort;
    QPushButton *m_pbOpen;
    QPushButton *m_pbFind;
    QPushButton *m_pbStart;
    QHBoxLayout *m_hblPort;
    QHBoxLayout *m_hblStart;
    QVBoxLayout *m_vblFlowmeter;
    QGroupBox *m_gbFlowmeter;

    QTimer *m_timer;
    HplcPumpPulseCompenCurvePage *m_widCurve = nullptr;
};

#endif // PUMPPULSECOMPENCALIBRATIONPAGE_H
